<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>动画</title>
    <style>
        .door {
            margin-left: 100px;
            position: relative;
            perspective: 10000px;
        }

        .box1 {
            position: absolute;
            left: 0;
            right: 0;
            transform-origin: left;
        }

        .box2 {
            position: absolute;
            left: 100px;
            right: 0;
            transform-origin: right;
        }

        .box1,.box2 {
            width: 100px;
            height: 180px;
            background-color: #17a2b8;
            transition: all 2s;

        }

        .door:hover .box1{
            transform: rotateY(-115deg);
        }
        .door:hover .box2{
            transform: rotateY(115deg);
        }
    </style>
</head>
<body>
<div class="door">
    <div class="box1"></div>
    <div class="box2"></div>
</div>
</body>
</html>
